﻿using Dispatcher.Tasks.Providers;
using Annow;
using MiniFox.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MiniFox;

namespace Dispatcher.Tasks
{
    public class QueueStarter : Component<IQueueDataProvider>, IApplicationRunner
    {
        public CancellationToken CancellationToken => throw new NotImplementedException();

        public void Dispose()
        {
        }

        public void OnProcess()
        {
            var queueItems = this.Provider.LoadQueueItems();
            QueueFactory.InitQueueGroups(queueItems);

            this.WriteInfoLog($"启动事件完成，已加载{queueItems.Count()}个队列项");
        }

        public void OnProcess(params string[] args)
        {
            throw new NotImplementedException();
        }

        public Task OnProcessAsync(params string[] args)
        {
            throw new NotImplementedException();
        }
    }
}
